#include <cstdio>
#include <cmath>
const int MAXN = 10000000;
bool p[MAXN] = {false}; //下标为素数的元素为false，0、1除外
int prime[MAXN];
int cnt = 0; //记录素数个数
//埃式筛法
void find_prime(int n)
{
    for (int i = 2; i < MAXN; ++i)
        if (p[i] == false)
        {
            prime[cnt++] = i;
            for (int j = i + i; j < MAXN; j += i)
            {                //开筛
                p[j] = true; //p[j] == true;//!!!!!!!!!!!
            }
            if (cnt == n)
                break;
        }
}
int main()
{
    int M, N;
    scanf("%d%d", &M, &N);
    find_prime(N);
    int count = 0;
    for (int i = M - 1; i < N; ++i, ++count)
    {
        if (count % 10 == 0){if(count)printf("\n");}
        else printf(" ");
        printf("%d", prime[i]);
    }
    printf("\n");
    return 0;
}